home *** CD-ROM | disk | FTP | other *** search
- function Preloader(baseClip, loadedFrame)
- {
- this.loadedFrame = loadedFrame;
- this.baseClip = baseClip;
- this.clip = this.baseClip.createEmptyMovieClip("preloaderClip",this.baseClip.getNextHighestDepth());
- this.clip.preloader = this;
- this.frame = 0;
- this.fractionLoaded = 0;
- this.loadedBytes = 0;
- this.totalBytes = 0;
- this.percentLoaded = 0;
- this.clip.onEnterFrame = this.evtEnterFrame;
- }
- function setupRightClickMenu(showDeeperbeigeLink)
- {
- var _loc2_ = new ContextMenu();
- _loc2_.hideBuiltInItems();
- if(showDeeperbeigeLink || showDeeperbeigeLink == undefined)
- {
- var _loc4_ = new ContextMenuItem("©2008 deeperbeige.com",function()
- {
- return undefined;
- });
- var _loc3_ = new ContextMenuItem("http://deeperbeige.com",function()
- {
- getUrl("http://deeperbeige.com", "_blank");
- });
- _loc3_.separatorBefore = true;
- _loc2_.customItems.push(_loc4_,_loc3_);
- }
- _root.menu = _loc2_;
- }
- function siteLockTest(contentID, lockedFrame, successCallback)
- {
- if(_root._url.substr(0,5) == "file:")
- {
- return successCallback();
- }
- trace("SiteLock: Testing \'" + contentID + "\'");
- var _loc4_ = new LoadVars();
- var _loc3_ = new LoadVars();
- _loc3_.successCallback = successCallback;
- _loc3_.lockedFrame = lockedFrame;
- _loc3_.onLoad = function(success)
- {
- if(this.allowed == 1 || !success)
- {
- trace("SiteLock: Allowed");
- this.successCallback();
- }
- else
- {
- trace("SiteLock: Failed");
- _root.legalURL = this.legalURL;
- _root.gotoAndStop(this.lockedFrame);
- }
- };
- _loc4_.contentID = contentID;
- _loc4_.hostURL = _root._url;
- _loc4_.r = Math.floor(Math.random() * 10000);
- _loc4_.sendAndLoad("http://deeperbeige.com/sitelock/check.php",_loc3_,"POST");
- }
- function ScreenTrans(contentRoot, screenClip, startFrame, fastTrans)
- {
- this.content = contentRoot;
- this.screen = screenClip;
- this.curFrame = startFrame;
- this.screenFrame = 0;
- this.transitioning = false;
- this.fastTrans = !fastTrans ? false : true;
- this.debug = false;
- if(!this.content)
- {
- trace("ScreenTrans: Content root is undefined");
- }
- if(!this.screen)
- {
- trace("ScreenTrans: Screen clip is undefined");
- }
- if(this.debug)
- {
- trace("ScreenTrans: Initialised");
- }
- }
- function ContentTrans(contentRoot, arrClips, startFrame, fastTrans)
- {
- this.content = contentRoot;
- this.curFrame = startFrame;
- this.transitioning = false;
- this.fastTrans = !fastTrans ? false : true;
- this.debug = false;
- this.contentClips = arrClips;
- if(!this.content)
- {
- trace("ContentTrans: Content root is undefined");
- }
- var _loc2_ = 0;
- while(_loc2_ < this.contentClips.length)
- {
- var _loc3_ = this.contentClips[_loc2_];
- if(!_loc3_)
- {
- trace("ContentTrans: Content clip " + _loc2_ + " is undefined");
- }
- _loc2_ = _loc2_ + 1;
- }
- if(this.debug)
- {
- trace("ContentTrans: Initialised");
- }
- }
- stop();
- Preloader.prototype.evtEnterFrame = function()
- {
- var _loc4_ = _root.getBytesLoaded();
- var _loc3_ = _root.getBytesTotal();
- this.preloader.frame = this.preloader.frame + 1;
- this.preloader.onUpdate();
- if(_loc4_ > 10 && _loc3_ > 10)
- {
- this.preloader.totalBytes = _loc3_;
- this.preloader.loadedBytes = _loc4_;
- this.preloader.fractionLoaded = _loc4_ / _loc3_;
- this.preloader.percentLoaded = Math.floor(_loc4_ * 100 / _loc3_);
- if(_loc4_ == _loc3_)
- {
- this.preloader.onLoaded();
- this.onEnterFrame = undefined;
- this.removeMovieClip();
- }
- }
- else
- {
- this.preloader.percentLoaded = 0;
- }
- this.preloader.loadingString = "Loading: " + this.preloader.percentLoaded + "%";
- };
- Preloader.prototype.onLoaded = function()
- {
- _root.gotoAndStop(this.loadedFrame);
- };
- Preloader.prototype.onUpdate = function()
- {
- trace(this.fractionLoaded);
- };
- ScreenTrans.prototype.goto = function(frame, onTransComplete)
- {
- if(this.curFrame == frame)
- {
- if(this.debug)
- {
- trace("ScreenTrans: Transition to \'" + frame + "\' disallowed: Already on this section");
- }
- return undefined;
- }
- if(this.transitioning)
- {
- if(this.debug)
- {
- trace("ScreenTrans: Transition to \'" + frame + "\' disallowed: Already transitioning");
- }
- return undefined;
- }
- if(this.debug)
- {
- trace("ScreenTrans: Transitioning to \'" + frame + "\'");
- }
- this.goingTo = frame;
- this.transitioning = true;
- this.onTransComplete = onTransComplete;
- this.content.objTrans = this;
- this.screen.objTrans = this;
- this.screen.prevFrameNo = this.screen._currentframe;
- this.screen.onEnterFrame = function()
- {
- if(this.debug)
- {
- trace("ScreenTrans: Hiding content (frame " + this._currentframe + ")");
- }
- if(this.prevFrameNo == this._currentframe || this.objTrans.fastTrans)
- {
- this.objTrans.next();
- }
- this.prevFrameNo = this._currentframe;
- };
- this.screen.gotoAndPlay("hide");
- };
- ScreenTrans.prototype.next = function()
- {
- if(this.debug)
- {
- trace("ScreenTrans: Content hidden. Switching to \'" + this.goingTo + "\'");
- }
- this.curFrame = this.goingTo;
- this.goingTo = undefined;
- this.screen.prevFrameNo = this.screen._currentframe;
- this.screen.onEnterFrame = function()
- {
- if(this.debug)
- {
- trace("ScreenTrans: Revealing content (frame " + this._currentframe + ")");
- }
- if(this.prevFrameNo == this._currentframe || this.objTrans.fastTrans)
- {
- this.objTrans.transComplete();
- }
- this.prevFrameNo = this._currentframe;
- };
- this.content.gotoAndStop(this.curFrame);
- this.screen.gotoAndPlay("reveal");
- };
- ScreenTrans.prototype.transComplete = function()
- {
- this.screen.onEnterFrame = undefined;
- this.transitioning = false;
- if(this.fastTrans)
- {
- this.screen.gotoAndStop("idle");
- }
- if(this.onTransComplete != undefined)
- {
- if(this.debug)
- {
- trace("ScreenTrans: Executing callback");
- }
- this.onTransComplete();
- }
- if(this.debug)
- {
- trace("ScreenTrans: Transition complete");
- }
- };
- ContentTrans.prototype.goto = function(frame, onTransComplete)
- {
- if(this.curFrame == frame)
- {
- if(this.debug)
- {
- trace("ContentTrans: Transition to \'" + frame + "\' disallowed: Already on this section");
- }
- return undefined;
- }
- if(this.transitioning)
- {
- if(this.debug)
- {
- trace("ContentTrans: Transition to \'" + frame + "\' disallowed: Already transitioning");
- }
- return undefined;
- }
- if(this.debug)
- {
- trace("ContentTrans: Transitioning to \'" + frame + "\'");
- }
- this.goingTo = frame;
- this.transitioning = true;
- this.onTransComplete = onTransComplete;
- this.content.objTrans = this;
- var _loc2_ = 0;
- while(_loc2_ < this.contentClips.length)
- {
- var _loc3_ = this.contentClips[_loc2_];
- _loc3_.prevFrameNo = -1;
- _loc2_ = _loc2_ + 1;
- }
- this.content.onEnterFrame = function()
- {
- var _loc4_ = true;
- var _loc3_ = 0;
- while(_loc3_ < this.objTrans.contentClips.length)
- {
- var _loc2_ = this.objTrans.contentClips[_loc3_];
- if(!this.objTrans.fastTrans)
- {
- if(_loc2_.prevFrameNo != _loc2_._currentframe)
- {
- _loc4_ = false;
- }
- _loc2_.prevFrameNo = _loc2_._currentframe;
- }
- _loc3_ = _loc3_ + 1;
- }
- if(_loc4_)
- {
- this.objTrans.next();
- }
- };
- _loc2_ = 0;
- while(_loc2_ < this.contentClips.length)
- {
- _loc3_ = this.contentClips[_loc2_];
- _loc3_.gotoAndPlay("out");
- _loc2_ = _loc2_ + 1;
- }
- };
- ContentTrans.prototype.next = function()
- {
- if(this.debug)
- {
- trace("ContentTrans: Content is now out. Switching to \'" + this.goingTo + "\'");
- }
- this.curFrame = this.goingTo;
- this.goingTo = undefined;
- this.content.objTrans = this;
- var _loc2_ = 0;
- while(_loc2_ < this.contentClips.length)
- {
- var _loc3_ = this.contentClips[_loc2_];
- _loc3_.prevFrameNo = -1;
- _loc2_ = _loc2_ + 1;
- }
- this.content.onEnterFrame = function()
- {
- var _loc4_ = true;
- var _loc3_ = 0;
- while(_loc3_ < this.objTrans.contentClips.length)
- {
- var _loc2_ = this.objTrans.contentClips[_loc3_];
- if(!this.objTrans.fastTrans)
- {
- if(_loc2_.prevFrameNo != _loc2_._currentframe)
- {
- _loc4_ = false;
- }
- _loc2_.prevFrameNo = _loc2_._currentframe;
- }
- _loc3_ = _loc3_ + 1;
- }
- if(_loc4_)
- {
- this.objTrans.transComplete();
- }
- };
- this.content.gotoAndStop(this.curFrame);
- _loc2_ = 0;
- while(_loc2_ < this.contentClips.length)
- {
- _loc3_ = this.contentClips[_loc2_];
- _loc3_.gotoAndPlay("in");
- _loc2_ = _loc2_ + 1;
- }
- };
- ContentTrans.prototype.transComplete = function()
- {
- this.content.onEnterFrame = undefined;
- this.transitioning = false;
- if(this.onTransComplete != undefined)
- {
- if(this.debug)
- {
- trace("ContentTrans: Executing callback");
- }
- this.onTransComplete();
- }
- if(this.debug)
- {
- trace("ContentTrans: Transition complete");
- }
- };
- com.mosesSupposes.fuse.ZigoEngine.simpleSetup(com.mosesSupposes.fuse.Shortcuts,com.mosesSupposes.fuse.PennerEasing);
- var objTrans = new ScreenTrans(_root,_root.screen,"preloader");
- var loadingComplete = false;
- var animComplete = false;
- var objPreloader = new Preloader(_root);
- objPreloader.onUpdate = function()
- {
- _root.loaded.text = "LOADED: " + this.percentLoaded + "%";
- };
- objPreloader.onLoaded = function()
- {
- _root.loadingComplete = true;
- _root.loaded.text = "PREPARING...";
- if(_root.animComplete)
- {
- _root.konggfx.play();
- }
- };
- setupRightClickMenu();
- _root.kongregateServices.connect();
- _level0.cmuSWF_ID = "HannaInAChoppa";
- if(_global.System)
- {
- System.security.allowDomain("www.deeperbeige.com");
- }
- loadMovieNum("http://www.deeperbeige.com/tracking/tracker.swf?r=" + (Math.floor(Math.random() * 10000) + 10000),19467);
-